<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="/include/head.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>T短信群发</title>
<script type="text/javascript">

$(document).ready(function(){

	testMsgConfirm = function(){
		var msgText = $("#tempMsgText", navTab.getCurrentPanel()).val();
		var msgLength = msgText.lenth;
		var toNo = $("#tempToNo", navTab.getCurrentPanel()).val();
		alertMsg.confirm("测试消息内容如下：" +
				"<br><br>" + msgText +					
				"<br><br>发送消息长度：" + msgText.length + "字" + 				
				"<br>大约总条数：" + Math.ceil((msgText.length + 10)/63) + 				
				"<br>接收手机号：" + toNo +
				"<br>是否确认发送测试消息？", 
			{
				okCall: function(){

					$("#msgText", navTab.getCurrentPanel()).val(msgText);
					$("#toNo", navTab.getCurrentPanel()).val(toNo);
					$("#form",navTab.getCurrentPanel()).attr("action","msg/sendSingleMsg.do?funId=${funId}");
					validateCallback($("#form",navTab.getCurrentPanel()), navTabAjaxDone);
				},
				cancelCall : function() {
					return false;
				}
			});
		return false;
	
	};

	sendMsgConfirm = function(){
		var msgText = $("#tempMsgText", navTab.getCurrentPanel()).val();
		var msgLength = msgText.lenth;
		var phoneNumQty = ${pager.resultList.size()};
		var toNo = $("#tempToNo", navTab.getCurrentPanel()).val();
		alertMsg.confirm("群发消息内容如下：" +
				"<br><br>" + msgText +					
				"<br><br>发送消息长度：" + msgText.length + "字" + 		
				"<br>接收手机数量：" + phoneNumQty +
				"<br>大约总条数：" + Math.ceil((msgText.length + 10)/63) * phoneNumQty + 		
				"<br>是否确认群发消息？", 
			{
				okCall: function(){

					$("#msgText", navTab.getCurrentPanel()).val(msgText);
					$("#toNo", navTab.getCurrentPanel()).val(toNo);
					$("#form",navTab.getCurrentPanel()).attr("action","msg/sendBatchMsg.do?funId=${funId}");
					validateCallback($("#form",navTab.getCurrentPanel()), navTabAjaxDone);
				},
				cancelCall : function() {
					return false;
				}
			});
		return false;
	};
	
	
});


</script>
</head>
<body>
	<form onsubmit="return navTabSearch(this);" action="msg/initMsg2Customer.do?funId=${funId}" method="post">
		<div class="pageContent"  layoutH="35">
			
			<div class="pageHeader">
				<form rel="pagerForm" id="searchForm" onsubmit="return navTabSearch(this);" action="msg/initMsg2Customer.do?funId=${funId}" method="post">
					<div class="searchBar">
						<table class="searchContent">
							<tr>
								<td>	
								  时间范围:<input type="text" name="map.createDate_B_I" class="date textInput readonly valid required" value="${pager.scMap.createDate_B_I}" size="10">
								  至:<input type="text" name="map.createDate_E_I" class="date textInput readonly valid required" value="${pager.scMap.createDate_E_I}" size="10">
								  
								 排序:<select name="map.orderBy_I" id="sendType">
										<option value="amt">充值消费金额</option>
										<option value="unPay">未收金额</option>
										<option value="lastBizDate">最近业务日期</option>
									  </select>
								前<input name="numPerPage" class="required number" size="4" value="${pager.numPerPage}">位
				       			</td>
							</tr>
						</table>
			       		<div class="subBar">
							<ul>
								<li><div class="buttonActive"><div class="buttonContent"><button type="submit">查询</button></div></div></li>
							</ul>
						</div>
					</div>
				</form>
			</div>
			
			
			
			
			<div class="tabs">
				<div class="tabsHeader">
					<div class="tabsHeaderContent">
						<ul>
							<li><a><span>会员号码</span></a></li>
							<li><a><span>外部号码</span></a></li>
						</ul>
					</div>
				</div>
					<form id="form" onsubmit="return navTabSearch(this);" action="" method="post">
						<input name="msgText" id="msgText" type="hidden"/>
						<input name="msgType" type="hidden" value="SMS_BATCH"/>
				<div class="tabsContent"  layoutH="137">
					<div>		
						<div class="panelBar">
							<ul class="toolBar"><!-- 
								<li><a class="icon" href="demo/common/dwz-team.xls" target="w_list_print" targetType="navTab" title="确实要导出这些记录吗?"><span>导出EXCEL</span></a></li>
								<li><a class="icon" href="javascript:$.printBox('w_list_print')"><span>打印</span></a></li> -->
							</ul>
						</div>			
						<table class="table" width="98%" targetType="navTab" asc="asc" desc="desc">
							<thead>
								<tr>
									<th width="30">No.</th>
									<th>会员姓名</th>
									<th width="125">手机号</th>
									<th width="125">最近业务日期</th>
									<th width="125">充值消费金额</th>
									<th width="125">未收金额</th><!-- 
									<th width="65">
										<button type="button" class="checkboxCtrl" group="items.endOrderItemId" selectType="invert">反选</button>
									</th> -->
								</tr>
							</thead>
							<tbody>
							
								<c:forEach items="${pager.resultList}" var="item" varStatus="varStatus">
									<tr target="sid_qcTodoList" rel="${item.id}" id="wg_tr_id_${varStatus.count-1}">
									
										<td align="right">${varStatus.count}</td>
										<td>${item.custName}</td>
										<td>${item.cellPhone}</td>
										<td>${item.lastBizDate}</td>
										<td align="right">${item.amt}</td>
										<td align="right">${item.unPay}</td><!-- 
										<td><input name="items.toCust" value="${item.custId}" type="text">
										<input name="items.toNo" value="${item.cellPhone}" type="text" onclick="checkedsWg()"></td> -->
									</tr>
								</c:forEach>
							</tbody>
						</table>
					</div>
					<div>
						<table class="searchContent">
							<tr>
								<td>	<br>
								  手机号码：<br><br>
				       			</td>
								<td><br>(请录入待发送的手机号码，手机号以英文逗号或回车换行符分隔)<br><br>
				       			</td>
				       			
							</tr>
							<tr>
								<td>	
				       			</td>
								<td>
								<textarea class="textInput" name="phoneNos" id="phoneNos" maxlength="480"cols="120" rows="25"></textarea>
				       			</td>
							</tr>
						</table>
					
					</div>
				</div>
					</form>
				<div class="tabsFooter">
					<div class="tabsFooterContent"></div>
				</div>
			</div>
		</div>
		
		<div class="formBar">
			<ul>
				<li>短信内容：<input id="tempMsgText" value="" size="100"/></li>
				<li>测试号码：<input id="tempToNo" value="" size="11"/></li>
				<li><div class="button"><div class="buttonContent"><button type="submit" onclick="return testMsgConfirm();">测试</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="submit" onclick="return sendMsgConfirm();">发送</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li>
			</ul>
		</div>



</body>
</html>


